#include<bits/stdc++.h>

using namespace std;
const int maxn = 1e6 + 500;
map<int, int> M;

int main() {
    for (int m = 2; m <= 10; m++) {
        int n = m;
        int c = 2;
        while (c * c <= n) {
            while (n % c == 0) {
                M[c]++;
                n /= c;
            }
            c++;
        }
        if (n != 1) {
            //cout << n;
            M[n]++;
        }
    }
    int d = 1;
    for (auto e:M) {
        cout << e.first << "^" << e.second << endl;
        d *= (e.second + 1);
    }
    cout << d << endl;//120的因子数
    return 0;
}